<!-- 主题设置模板 -->

<script type="text/html" template lay-done="layui.data.theme();">
    {{#
    var local = layui.data(layui.setter.tableName)
    ,theme = local.theme || {}
    ,themeColorIndex =  parseInt((theme && theme.color) ? theme.color.index : 0) || 0;
    }}

    <div class="layui-card-header">
        测试
    </div>
    <div class="layui-card-body layadmin-setTheme">
        这里什么都没有
    </div>
</script>

<script>
    layui.data.theme = function () {
        layui.use('form', function () {
            var form = layui.form
                , admin = layui.admin;

            //监听隐藏开关
            form.on('switch(system-theme-sideicon)', function () {
                admin.theme({
                    hideSideIcon: this.checked
                })
            });
        });
    };
</script>
